<?php
$custom_image_size = array(
	// 'custom-size' => array(
	// 	'width' => 224,
	// 	'height' => 126,
	// 	'crop' => 1
	// )
);

function wpdev_custom_image_size($size){
	global $custom_image_size;

	$keys = array_keys($custom_image_size);
	foreach ($keys as $size_) {
		$test_value = get_option($size_.'_size_w');

		if(!$test_value){
			add_option($size_.'_size_w', $custom_image_size[$size_]['width']);
			add_option($size_.'_size_h', $custom_image_size[$size_]['height']);
			add_option($size_.'_crop', $custom_image_size[$size_]['crop']);
		}

		$size[] = $size_;
	}

	return $size;
}
// add_filter('intermediate_image_sizes', 'wpdev_custom_image_size');